home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / update~3.z / update~3 / dir_diffs next >
Encoding:
Text File  |  1989-08-31  |  4.3 KB  |  167 lines

  1. *** /tmp/,RCSt1a24495    Thu Aug 31 21:09:34 1989
  2. --- dirtent.h    Thu Aug 31 21:09:02 1989
  3. ***************
  4. *** 1,3 ****
  5. --- 1,6 ----
  6. + #ifndef _DIRENT_H
  7. + #define _DIRENT_H
  8.   /*
  9.       <dirent.h> -- definitions for SVR3 directory access routines
  10.   
  11. ***************
  12. *** 19,24 ****
  13. --- 22,49 ----
  14.       char    *dd_buf;        /* -> directory block */
  15.       }    DIR;            /* stream data from opendir() */
  16.   
  17. + #ifdef __STDC__
  18. + #include <std.h>
  19. + #ifndef __NO_PROTO__
  20. + int closedir(DIR *);
  21. + int getdents(int, char *, unsigned);
  22. + DIR *opendir(char *);
  23. + struct dirent *readdir(DIR *);
  24. + void rewinddir(DIR *);
  25. + void seekdir(DIR *, long);
  26. + off_t telldir(DIR *);
  27. + #else
  28. + extern int closedir();
  29. + extern int getdents();
  30. + extern DIR *opendir();
  31. + extern struct dirent *readdir();
  32. + extern void rewinddir();
  33. + extern void seekdir();
  34. + extern off_t telldir();
  35. + #endif /* __NO_PROTO__ */
  36. + #else
  37.   extern DIR        *opendir();
  38.   extern struct dirent    *readdir();
  39.   extern off_t        telldir();
  40. ***************
  41. *** 26,31 ****
  42. --- 51,64 ----
  43.   extern void        rewinddir();
  44.   extern int        closedir();
  45.   
  46. + #endif
  47.   #ifndef NULL
  48. + #ifdef __STDC__
  49. + #define    NULL    ((void *)0L)        /* DAG -- added for convenience */
  50. + #else
  51.   #define    NULL    0            /* DAG -- added for convenience */
  52.   #endif
  53. + #endif
  54. + #endif /* _DIRENT_H */
  55. *** /tmp/,RCSt1a24495    Thu Aug 31 21:09:37 1989
  56. --- getdents.c    Thu Aug 31 21:09:03 1989
  57. ***************
  58. *** 102,108 ****
  59.   extern int    errno;
  60.   
  61.   #ifndef DIRBLKSIZ
  62. ! #define    DIRBLKSIZ    1024        /* directory file read buffer size */
  63.   #endif
  64.   
  65.   #ifndef NULL
  66. --- 102,115 ----
  67.   extern int    errno;
  68.   
  69.   #ifndef DIRBLKSIZ
  70. ! /* directory file read buffer size
  71. !  * For directory files with fixed sized records, this should be a
  72. !  * multiple of the record size.  For variable sized records, this code
  73. !  * is probably unreliable if the directory is larger than DIRBLKSIZ --
  74. !  * so make DIRBLKSIZ big.
  75. !  */
  76. ! /* #define    DIRBLKSIZ ((int)(64*sizeof(struct direct))) */ /* ==1024 */
  77. ! #define    DIRBLKSIZ    1024
  78.   #endif
  79.   
  80.   #ifndef NULL
  81. ***************
  82. *** 111,116 ****
  83. --- 118,124 ----
  84.   
  85.   #ifndef SEEK_CUR
  86.   #define    SEEK_CUR    1
  87. + #define    SEEK_SET    0
  88.   #endif
  89.   
  90.   #ifndef S_ISDIR                /* macro to test for directory file */
  91. ***************
  92. *** 272,279 ****
  93.   
  94.                   if ( (char *)bp + reclen > &buf[nbyte] )
  95.                       {
  96. !                     errno = EINVAL;
  97. !                     return -1;    /* buf too small */
  98.                       }
  99.   
  100.                   bp->d_ino = dp->d_fileno;
  101. --- 280,297 ----
  102.   
  103.                   if ( (char *)bp + reclen > &buf[nbyte] )
  104.                       {
  105. ! /* fix thanks to culberts@hpccc.HP.COM (Bruce Culbertson) */
  106. !                     /* buf too small, lseek so we get the
  107. !                      * rest on next call to getdents() 
  108. !                      */
  109. !                     if (lseek (fildes,
  110. !                     (long)((char *)dp-u.dblk+offset),
  111. !                     SEEK_SET) < 0)
  112. !                         {
  113. !                         /* errno set by lseek */
  114. !                         return -1;
  115. !                         }
  116. !                     break;
  117.                       }
  118.   
  119.                   bp->d_ino = dp->d_fileno;
  120. *** /tmp/,RCSt1a24495    Thu Aug 31 21:09:43 1989
  121. --- sys.dirtent.h    Thu Aug 31 21:09:04 1989
  122. ***************
  123. *** 1,3 ****
  124. --- 1,6 ----
  125. + #ifndef _SYS_DIRENT_H
  126. + #define _SYS_DIRENT_H
  127.   /*
  128.       <sys/dirent.h> -- file system independent directory entry (SVR3)
  129.   
  130. ***************
  131. *** 16,25 ****
  132.   
  133.   /* The following nonportable ugliness could have been avoided by defining
  134.      DIRENTSIZ and DIRENTBASESIZ to also have (struct dirent *) arguments. */
  135. ! #define    DIRENTBASESIZ        (((struct dirent *)0)->d_name \
  136. !                 - (char *)&((struct dirent *)0)->d_ino)
  137. ! #define    DIRENTSIZ( namlen )    ((DIRENTBASESIZ + sizeof(long) + (namlen)) \
  138. !                 / sizeof(long) * sizeof(long))
  139.   
  140.   /* DAG -- the following was moved from <dirent.h>, which was the wrong place */
  141.   #define    MAXNAMLEN    512        /* maximum filename length */
  142. --- 19,28 ----
  143.   
  144.   /* The following nonportable ugliness could have been avoided by defining
  145.      DIRENTSIZ and DIRENTBASESIZ to also have (struct dirent *) arguments. */
  146. ! #define    DIRENTBASESIZ        (int)((((struct dirent *)0)->d_name \
  147. !                 - (char *)&((struct dirent *)0)->d_ino))
  148. ! #define    DIRENTSIZ( namlen ) (int)(((DIRENTBASESIZ + sizeof(long) + (namlen)) \
  149. !                 / sizeof(long) * sizeof(long)))
  150.   
  151.   /* DAG -- the following was moved from <dirent.h>, which was the wrong place */
  152.   #define    MAXNAMLEN    512        /* maximum filename length */
  153. ***************
  154. *** 27,29 ****
  155. --- 30,34 ----
  156.   #ifndef NAME_MAX
  157.   #define    NAME_MAX    (MAXNAMLEN - 1)    /* DAG -- added for POSIX */
  158.   #endif
  159. + #endif /* _SYS_DIRENT_H */
  160.